package com.cncytech.uiautomator_demo.testcase;

import com.cncytech.uiautomator_demo.BaseTest;
import com.cncytech.uiautomator_demo.TestConstant;
import com.cncytech.uiautomator_demo.RetryWatcher;
import com.cncytech.uiautomator_demo.utils.Describe;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;

import org.junit.Rule;
import org.junit.Test;

/**
 * 生物识别测试
 */
public class BiometricRecognitionPoliciesTest extends BaseTest {
    @Rule
    public RetryWatcher retryWatcher = new RetryWatcher(TestConstant.retryCount);

    @Test
    @Describe(TestConstant.BIOMETRIC_FORBIDDEN)
    public void biometricForbiddenTest() {
        String msg = TestConstant.BIOMETRIC_FORBIDDEN + TestConstant.FAILURE;
        int status = 0;
        assertThat(msg,hmm.setBiometricRecognitionPolicies(status));
        int biometricRecognitionPolicies = hmm.getBiometricRecognitionPolicies();
        assertThat(msg,biometricRecognitionPolicies,is(status));
    }

    @Test
    @Describe(TestConstant.BIOMETRIC_ENABLE)
    public void biometricEnableTest() {
        String msg = TestConstant.BIOMETRIC_FORBIDDEN + TestConstant.FAILURE;
        int status = 1;
        assertThat(msg,hmm.setBiometricRecognitionPolicies(status));
        int biometricRecognitionPolicies = hmm.getBiometricRecognitionPolicies();
        assertThat(msg,biometricRecognitionPolicies,is(status));
    }
}
